﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:MahApps.Metro.Controls"
                    xmlns:Behaviors="clr-namespace:MahApps.Metro.Behaviours"
                    xmlns:Converters="clr-namespace:MahApps.Metro.Converters">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Shared.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <Converters:ThicknessToDoubleConverter x:Key="ThicknessToDoubleConverter" />
    <Converters:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
    <Converters:StringToVisibilityConverter x:Key="StringToOppositeVisibilityConverter" OppositeStringValue="True" />

    <Grid x:Key="RevealButtonIcon"
          x:Shared="False"
          Background="{DynamicResource BlackBrush}"
          Opacity="0.8"
          Width="16"
          Height="16">
        <Grid.OpacityMask>
            <VisualBrush>
                <VisualBrush.Visual>
                    <Canvas Height="25.8461"
                            Width="42">
                        <Path Canvas.Left="17"
                              Canvas.Top="25.0769"
                              Stretch="Fill"
                              Data="F1 M 38,33.1538C 40.6765,33.1538 42.8462,35.3235 42.8462,38C 42.8462,40.6765 40.6765,42.8461 38,42.8461C 35.3235,42.8461 33.1539,40.6765 33.1539,38C 33.1539,35.3235 35.3236,33.1538 38,33.1538 Z M 38,25.0769C 49.3077,25.0769 59,33.1538 59,38C 59,42.8461 49.3077,50.9231 38,50.9231C 26.6923,50.9231 17,42.8461 17,38C 17,33.1538 26.6923,25.0769 38,25.0769 Z M 38,29.1154C 33.0932,29.1154 29.1154,33.0932 29.1154,38C 29.1154,42.9068 33.0932,46.8846 38,46.8846C 42.9068,46.8846 46.8846,42.9068 46.8846,38C 46.8846,33.0932 42.9068,29.1154 38,29.1154 Z "
                              Fill="Black" />
                    </Canvas>
                </VisualBrush.Visual>
            </VisualBrush>
        </Grid.OpacityMask>
    </Grid>

    <!--Button Style for Win8MetroPasswordBox-->
    <Style x:Key="RevealButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Border x:Name="PasswordRevealIconEyeBorder" Background="Transparent" Margin="1,1,3,1" BorderThickness="{TemplateBinding BorderThickness}">
                            <Rectangle Width="20" Height="15" x:Name="IconEye" VerticalAlignment="Center" Margin="3,0" HorizontalAlignment="Center" Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}">
                                <Rectangle.OpacityMask>
                                    <VisualBrush Stretch="Fill" Visual="{StaticResource RevealButtonIcon}" />
                                </Rectangle.OpacityMask>
                            </Rectangle>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding ElementName=PasswordRevealIconEyeBorder, Path=IsMouseOver}" Value="True">
                            <Setter TargetName="PasswordRevealIconEyeBorder" Property="Background" Value="Gainsboro" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsPressed}" Value="True">
                            <Setter TargetName="PasswordRevealIconEyeBorder" Property="Background" Value="{DynamicResource BlackBrush}" />
                            <Setter TargetName="IconEye" Property="Fill" Value="{DynamicResource WhiteBrush}" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Win8MetroPasswordBox Style-->
    <Style TargetType="{x:Type PasswordBox}" x:Key="Win8MetroPasswordBox">
        <Setter Property="ContextMenu" Value="{DynamicResource TextBoxMetroContextMenu}" />
        <Setter Property="Controls:TextBoxHelper.IsMonitoring" Value="True" />
        <Setter Property="Controls:ControlsHelper.ButtonWidth" Value="22" />
        <Setter Property="PasswordChar" Value="●"/>
        <Setter Property="SelectionBrush" Value="{DynamicResource HighlightBrush}" />
        <Setter Property="FontFamily" Value="{DynamicResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="15" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="MinHeight" Value="26" />
        <Setter Property="Background" Value="{DynamicResource ControlBackgroundBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Padding" Value="4,1,4,1" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderBrush}" />
        <Setter Property="Controls:ControlsHelper.FocusBorderBrush" Value="{DynamicResource TextBoxFocusBorderBrush}" />
        <Setter Property="Controls:ControlsHelper.MouseOverBorderBrush" Value="{DynamicResource TextBoxMouseOverBorderBrush}" />
        <!-- change SnapsToDevicePixels to true to view a better border and validation error -->
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Validation.ErrorTemplate" Value="{DynamicResource ValidationErrorTemplate}" />
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="enterGotFocus">
                            <DoubleAnimation Duration="0:0:0.2" To=".2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="TextBoxHint" />
                        </Storyboard>
                        <Storyboard x:Key="exitGotFocus">
                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="TextBoxHint" />
                        </Storyboard>
                        <Storyboard x:Key="enterHasText">
                            <DoubleAnimation Duration="0:0:0.2" From=".2" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="TextBoxHint" />
                        </Storyboard>
                        <Storyboard x:Key="exitHasText">
                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="TextBoxHint" />
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid Margin="0" VerticalAlignment="Stretch">
                        <Rectangle x:Name="Base"
                                Stroke="{TemplateBinding BorderBrush}"
                                StrokeThickness="{TemplateBinding BorderThickness, Converter={StaticResource ThicknessToDoubleConverter}}"
                                Opacity="1"
                                Fill="{TemplateBinding Background}" />
                        <Rectangle x:Name="FocusRectangle"
                                Visibility="Collapsed"
                                StrokeThickness="{TemplateBinding BorderThickness, Converter={StaticResource ThicknessToDoubleConverter}}" />
                        <Grid VerticalAlignment="Stretch" Margin="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <ScrollViewer x:Name="PART_ContentHost" Margin="0" Padding="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            <TextBox x:Name="RevealedPassword"
                                     Grid.Column="0" Grid.Row="0"
									Text="{TemplateBinding Behaviors:PasswordBoxBindingBehavior.Password}"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       VerticalAlignment="Stretch"
									VerticalContentAlignment="Stretch"
					                Margin="1,1,1,1"
                                     Padding="-1,1,1,1"
                                      BorderBrush="Transparent"
									Visibility="Hidden" BorderThickness="1" IsReadOnly="True" />
                            <TextBlock x:Name="TextBoxHint"
									    Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
					                    Grid.Column="0" Grid.Row="0"
                                        Padding="6,0,6,0"
                                       Margin="2,0,2,0"
                                        IsHitTestVisible="False"
                                        Opacity="0.6"
										Cursor="IBeam" Foreground="{TemplateBinding Foreground}"
                                       HorizontalAlignment="Stretch"
                                       VerticalAlignment="Center"
										Visibility="{Binding ElementName=RevealedPassword, Path=Text, Converter={StaticResource StringToOppositeVisibilityConverter}}" />
                            <Button x:Name="RevealButton"
									Grid.Column="1" Grid.Row="0" SnapsToDevicePixels="True"
									Style="{StaticResource RevealButtonStyle}"
									Visibility="{Binding ElementName=RevealedPassword, Path=Text, Converter={StaticResource StringToVisibilityConverter}}">
                            </Button>
                        </Grid>
                        <Rectangle x:Name="DisabledVisualElement"
                                   Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.DisabledVisualElementVisibility), Mode=OneWay}"
                                   Stroke="{DynamicResource ControlsDisabledBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness, Converter={StaticResource ThicknessToDoubleConverter}}"
                                   Fill="{DynamicResource ControlsDisabledBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}" />
                            <Setter Property="Opacity" TargetName="RevealButton" Value="0.5" />
                            <Setter Property="Text" TargetName="TextBoxHint" Value="{}{disabled} "/>
                            <Setter TargetName="DisabledVisualElement" Property="Opacity" Value="0.6" />
                        </Trigger>
                        <DataTrigger Binding="{Binding ElementName=RevealButton, Path=IsPressed}" Value="True">
                            <Setter TargetName="RevealedPassword" Property="Visibility" Value="Visible" />
                            <Setter Property="Foreground" Value="Transparent" />
                            <Setter Property="PasswordChar" Value=" " />
                        </DataTrigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="FocusRectangle" Property="Visibility" Value="Visible" />
                            <Setter TargetName="FocusRectangle" Property="Stroke" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter TargetName="FocusRectangle" Property="Visibility" Value="Visible" />
                            <Setter TargetName="FocusRectangle" Property="Stroke" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Controls:TextBoxHelper.HasText" Value="False" />
                                <Condition Property="IsFocused" Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterGotFocus}" />
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitGotFocus}" />
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>
                        <Trigger Property="Controls:TextBoxHelper.HasText" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterHasText}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitHasText}" />
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="True">
                            <Setter TargetName="Base" Property="Effect">
                                <Setter.Value>
                                    <DropShadowEffect ShadowDepth="0" Color="{DynamicResource BlackColor}" Opacity="0" BlurRadius="10" />
                                </Setter.Value>
                            </Setter>
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation From="0" To="1" Storyboard.TargetName="Base" Storyboard.TargetProperty="(Effect).Opacity" Duration="00:00:02" AutoReverse="True" RepeatBehavior="Forever" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                        </Trigger>
                        <Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="False">
                            <Setter TargetName="Base" Property="Effect" Value="{x:Null}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Grid x:Key="DefaultCapsLockIcon"
          x:Shared="False"
          Background="{DynamicResource BlackBrush}"
          Opacity="0.8"
          Width="16"
          Height="16">
        <Grid.OpacityMask>
            <VisualBrush>
                <VisualBrush.Visual>
                    <Canvas Width="24"
                            Height="24">
                        <Path Data="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"
                              Fill="Black" />
                    </Canvas>
                </VisualBrush.Visual>
            </VisualBrush>
        </Grid.OpacityMask>
    </Grid>

    <!--PasswordBox Style-->
    <Style TargetType="{x:Type PasswordBox}"
           x:Key="MetroPasswordBox">
        <Setter Property="Controls:PasswordBoxHelper.CapsLockIcon"
                Value="{StaticResource DefaultCapsLockIcon}" />
        <Setter Property="ContextMenu"
                Value="{DynamicResource TextBoxMetroContextMenu}" />
        <Setter Property="Controls:TextBoxHelper.IsMonitoring"
                Value="True" />
        <Setter Property="Controls:ControlsHelper.ButtonWidth"
                Value="22" />
        <Setter Property="SelectionBrush"
                Value="{DynamicResource HighlightBrush}" />
        <Setter Property="FontFamily"
                Value="{DynamicResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{DynamicResource ContentFontSize}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="MinHeight"
                Value="26" />
        <Setter Property="Background"
                Value="{DynamicResource ControlBackgroundBrush}" />
        <Setter Property="Foreground"
                Value="{DynamicResource TextBrush}" />
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="BorderBrush"
                Value="{DynamicResource TextBoxBorderBrush}" />
        <Setter Property="Controls:ControlsHelper.FocusBorderBrush"
                Value="{DynamicResource TextBoxFocusBorderBrush}" />
        <Setter Property="Controls:ControlsHelper.MouseOverBorderBrush"
                Value="{DynamicResource TextBoxMouseOverBorderBrush}" />
        <!-- change SnapsToDevicePixels to true to view a better border and validation error -->
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Validation.ErrorTemplate"
                Value="{DynamicResource ValidationErrorTemplate}" />
        <Setter Property="CaretBrush"
                Value="{DynamicResource BlackBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="enterGotFocus">
                            <DoubleAnimation Duration="0:0:0.2"
                                             To=".2"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>
                        <Storyboard x:Key="exitGotFocus">
                            <DoubleAnimation Duration="0:0:0.2"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>

                        <Storyboard x:Key="enterHasText">
                            <DoubleAnimation Duration="0:0:0.2"
                                             From=".2"
                                             To="0"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>
                        <Storyboard x:Key="exitHasText">
                            <DoubleAnimation Duration="0:0:0.2"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid>
                        <Border x:Name="Base"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}" />
                        <Grid Margin="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition x:Name="ButtonColumn"
                                                  Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition x:Name="ButtonRow"
                                               Height="*" />
                            </Grid.RowDefinitions>

                            <ScrollViewer x:Name="PART_ContentHost"
                                          Grid.Column="0"
                                          Grid.Row="1"
                                          BorderThickness="0"
                                          IsTabStop="False"
                                          Margin="2"
                                          VerticalAlignment="Stretch"
                                          Background="{x:Null}" />
                            <TextBlock x:Name="Message"
                                       Grid.Column="0"
                                       Grid.Row="1"
                                       Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                       Padding="{TemplateBinding Padding}"
                                       Visibility="Collapsed"
                                       Foreground="{TemplateBinding Foreground}"
                                       IsHitTestVisible="False"
                                       Opacity="0.6"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                       Margin="6,2,6,2" />
                            <Grid x:Name="FloatingMessageContainer"
                                  Grid.Column="0"
                                  Grid.ColumnSpan="2"
                                  Height="0"
                                  IsHitTestVisible="False"
                                  Margin="5,0"
                                  Visibility="Visible">
                                <TextBlock x:Name="FloatingMessage"
                                           Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                           FontSize="{DynamicResource FloatingWatermarkFontSize}"
                                           Foreground="{TemplateBinding Foreground}"
                                           Opacity="0.6"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <TextBlock.RenderTransform>
                                        <TranslateTransform />
                                    </TextBlock.RenderTransform>
                                </TextBlock>
                            </Grid>
                            <Button x:Name="PART_ClearText"
                                    Grid.Column="2"
                                    Grid.RowSpan="2"
                                    Style="{DynamicResource ChromelessButtonStyle}"
                                     Foreground="{TemplateBinding Foreground}"
                                    FontFamily="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ButtonFontFamily), Mode=OneWay}"
                                    Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ButtonContent), Mode=OneWay}"
                                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ClearTextButton), Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"
                                    Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.ButtonWidth), Mode=OneWay}"
                                    Controls:TextBoxHelper.IsClearTextButtonBehaviorEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ClearTextButton), Mode=OneWay}"
                                    IsTabStop="False" />
                            <ContentPresenter x:Name="PART_CapsLockIndicator"
                                              Grid.Row="0"
                                              Grid.Column="1"
                                              Grid.RowSpan="2"
                                              Margin="1"
                                              TextBlock.Foreground="{DynamicResource ControlsValidationBrush}"
                                              Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockIcon), Mode=TwoWay}"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="Right"
                                              ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockWarningToolTip), Mode=OneWay}"
                                              Visibility="Collapsed" />
                        </Grid>
                        <Border x:Name="DisabledVisualElement"
                                Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.DisabledVisualElementVisibility), Mode=OneWay}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderBrush="{DynamicResource ControlsDisabledBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{DynamicResource ControlsDisabledBrush}"
                                IsHitTestVisible="False"
                                Opacity="0" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Password, Mode=OneWay}"
                                     Value="">
                            <Setter TargetName="Message"
                                    Property="Visibility"
                                    Value="Visible" />
                        </DataTrigger>

                        <!--Sets the MiniMessage visibility (Watermark must not be "" and FloatWatermark must be true)-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.HasText)}"
                                     Value="False">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                        <!--To override Watermark == ""-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.Watermark)}"
                                     Value="">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                        <!--To override TextBoxHelper.UseFloatingWatermark == false-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.UseFloatingWatermark)}"
                                     Value="False">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </DataTrigger.ExitActions>
                        </DataTrigger>

                        <Trigger Property="IsMouseOver"
                                 Value="True">
                            <Setter TargetName="Base"
                                    Property="BorderBrush"
                                    Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="False">
                            <Setter TargetName="DisabledVisualElement"
                                    Property="Opacity"
                                    Value="0.6" />
                        </Trigger>
                        <Trigger Property="IsFocused"
                                 Value="True">
                            <Setter TargetName="Base"
                                    Property="BorderBrush"
                                    Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
                            <Setter TargetName="FloatingMessage"
                                    Property="Foreground"
                                    Value="{DynamicResource AccentColorBrush}" />
                            <Setter TargetName="FloatingMessage"
                                    Property="Opacity"
                                    Value="1" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText"
                                 Property="IsMouseOver"
                                 Value="True">
                            <Setter TargetName="PART_ClearText"
                                    Property="Background"
                                    Value="{DynamicResource GrayBrush8}" />
                            <Setter TargetName="PART_ClearText"
                                    Property="Foreground"
                                    Value="{DynamicResource AccentColorBrush}" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText"
                                 Property="IsPressed"
                                 Value="True">
                            <Setter TargetName="PART_ClearText"
                                    Property="Background"
                                    Value="{DynamicResource BlackBrush}" />
                            <Setter TargetName="PART_ClearText"
                                    Property="Foreground"
                                    Value="{DynamicResource WhiteBrush}" />
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Controls:TextBoxHelper.HasText"
                                           Value="False" />
                                <Condition Property="IsFocused"
                                           Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterGotFocus}" />
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitGotFocus}" />
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>

                        <Trigger Property="Controls:TextBoxHelper.HasText"
                                 Value="True">
                            <Setter TargetName="Message"
                                    Property="Visibility"
                                    Value="Visible" />
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterHasText}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitHasText}" />
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Button Command PasswordBox Style-->
    <Style TargetType="{x:Type PasswordBox}"
           BasedOn="{StaticResource MetroPasswordBox}"
           x:Key="MetroButtonPasswordBox">
        <Setter Property="Controls:TextBoxHelper.ButtonTemplate"
                Value="{DynamicResource ChromelessButtonTemplate}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="enterGotFocus">
                            <DoubleAnimation Duration="0:0:0.2"
                                             To=".2"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>
                        <Storyboard x:Key="exitGotFocus">
                            <DoubleAnimation Duration="0:0:0.2"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>

                        <Storyboard x:Key="enterHasText">
                            <DoubleAnimation Duration="0:0:0.2"
                                             From=".2"
                                             To="0"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>
                        <Storyboard x:Key="exitHasText">
                            <DoubleAnimation Duration="0:0:0.2"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid>
                        <Border x:Name="Base"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}" />
                        <Grid x:Name="PART_InnerGrid"
                              Margin="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition x:Name="ButtonColumn"
                                                  Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.ButtonWidth), Mode=OneWay}" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition x:Name="ButtonRow"
                                               Height="*" />
                            </Grid.RowDefinitions>

                            <ScrollViewer x:Name="PART_ContentHost"
                                          Grid.Column="0"
                                          Grid.Row="1"
                                          BorderThickness="0"
                                          IsTabStop="False"
                                          Margin="2"
                                          VerticalAlignment="Stretch"
                                          Background="{x:Null}" />
                            <TextBlock x:Name="Message"
                                       Grid.Column="0"
                                       Grid.Row="1"
                                       Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                       Padding="{TemplateBinding Padding}"
                                       Visibility="Collapsed"
                                       Foreground="{TemplateBinding Foreground}"
                                       IsHitTestVisible="False"
                                       Opacity="0.6"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                       Margin="6,2,6,2" />
                            <Grid x:Name="FloatingMessageContainer"
                                  Grid.Column="0"
                                  Grid.ColumnSpan="2"
                                  Height="0"
                                  IsHitTestVisible="False"
                                  Margin="5,0"
                                  Visibility="Visible">
                                <TextBlock x:Name="FloatingMessage"
                                           Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                           FontSize="{DynamicResource FloatingWatermarkFontSize}"
                                           Foreground="{TemplateBinding Foreground}"
                                           Opacity="0.6"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <TextBlock.RenderTransform>
                                        <TranslateTransform />
                                    </TextBlock.RenderTransform>
                                </TextBlock>
                            </Grid>
                            <Button x:Name="PART_ClearText"
                                    Grid.Column="2"
                                    Grid.RowSpan="2"
                                    Style="{DynamicResource ChromelessButtonStyle}"
                                     Foreground="{TemplateBinding Foreground}"
                                    FontFamily="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ButtonFontFamily), Mode=OneWay}"
                                    Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ButtonContent), Mode=OneWay}"
                                    Template="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ButtonTemplate), Mode=OneWay}"
                                    Controls:TextBoxHelper.IsClearTextButtonBehaviorEnabled="True"
                                    IsTabStop="False" />
                            <ContentPresenter x:Name="PART_CapsLockIndicator"
                                              Grid.Row="0"
                                              Grid.Column="1"
                                              Grid.RowSpan="2"
                                              Margin="1"
                                              TextBlock.Foreground="{DynamicResource ControlsValidationBrush}"
                                              Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockIcon), Mode=TwoWay}"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="Right"
                                              ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockWarningToolTip), Mode=OneWay}"
                                              Visibility="Collapsed" />
                        </Grid>
                        <Border x:Name="DisabledVisualElement"
                                Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.DisabledVisualElementVisibility), Mode=OneWay}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderBrush="{DynamicResource ControlsDisabledBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{DynamicResource ControlsDisabledBrush}"
                                IsHitTestVisible="False"
                                Opacity="0" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Password, Mode=OneWay}"
                                     Value="">
                            <Setter TargetName="Message"
                                    Property="Visibility"
                                    Value="Visible" />
                        </DataTrigger>

                        <!--Sets the MiniMessage visibility (Watermark must not be "" and FloatWatermark must be true)-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.HasText)}"
                                     Value="False">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                        <!--To override Watermark == ""-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.Watermark)}"
                                     Value="">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                        <!--To override TextBoxHelper.FloatingWatermark == false-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.UseFloatingWatermark)}"
                                     Value="False">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </DataTrigger.ExitActions>
                        </DataTrigger>

                        <Trigger Property="IsMouseOver"
                                 Value="True">
                            <Setter TargetName="Base"
                                    Property="BorderBrush"
                                    Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="False">
                            <Setter TargetName="DisabledVisualElement"
                                    Property="Opacity"
                                    Value="0.6" />
                        </Trigger>
                        <Trigger Property="IsFocused"
                                 Value="True">
                            <Setter TargetName="Base"
                                    Property="BorderBrush"
                                    Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
                            <Setter TargetName="FloatingMessage"
                                    Property="Foreground"
                                    Value="{DynamicResource AccentColorBrush}" />
                            <Setter TargetName="FloatingMessage"
                                    Property="Opacity"
                                    Value="1" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText"
                                 Property="IsMouseOver"
                                 Value="True">
                            <Setter TargetName="PART_ClearText"
                                    Property="Background"
                                    Value="{DynamicResource GrayBrush8}" />
                            <Setter TargetName="PART_ClearText"
                                    Property="Foreground"
                                    Value="{DynamicResource AccentColorBrush}" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText"
                                 Property="IsPressed"
                                 Value="True">
                            <Setter TargetName="PART_ClearText"
                                    Property="Background"
                                    Value="{DynamicResource BlackBrush}" />
                            <Setter TargetName="PART_ClearText"
                                    Property="Foreground"
                                    Value="{DynamicResource WhiteBrush}" />
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Controls:TextBoxHelper.HasText"
                                           Value="False" />
                                <Condition Property="IsFocused"
                                           Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterGotFocus}" />
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitGotFocus}" />
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>

                        <Trigger Property="Controls:TextBoxHelper.HasText"
                                 Value="True">
                            <Setter TargetName="Message"
                                    Property="Visibility"
                                    Value="Visible" />
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterHasText}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitHasText}" />
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Button Revealed PasswordBox Style-->
    <Style TargetType="{x:Type PasswordBox}"
           BasedOn="{StaticResource MetroPasswordBox}"
           x:Key="MetroButtonRevealedPasswordBox">
        <Setter Property="Controls:TextBoxHelper.ButtonTemplate"
                Value="{DynamicResource ChromelessButtonTemplate}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="enterGotFocus">
                            <DoubleAnimation Duration="0:0:0.2"
                                             To=".2"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>
                        <Storyboard x:Key="exitGotFocus">
                            <DoubleAnimation Duration="0:0:0.2"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>

                        <Storyboard x:Key="enterHasText">
                            <DoubleAnimation Duration="0:0:0.2"
                                             From=".2"
                                             To="0"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>
                        <Storyboard x:Key="exitHasText">
                            <DoubleAnimation Duration="0:0:0.2"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="Message" />
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid>
                        <Border x:Name="Base"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}" />
                        <Grid x:Name="PART_InnerGrid"
                              Margin="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition x:Name="ButtonColumn"
                                                  Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition x:Name="ButtonRow"
                                               Height="*" />
                            </Grid.RowDefinitions>

                            <ScrollViewer x:Name="PART_ContentHost"
                                          Grid.Column="0"
                                          Grid.Row="1"
                                          BorderThickness="0"
                                          IsTabStop="False"
                                          Margin="2"
                                          VerticalAlignment="Stretch"
                                          Background="{x:Null}" />
                            <TextBox x:Name="RevealedPassword"
                                    Grid.Column="0"
                                    Grid.Row="1"
									Text="{TemplateBinding Behaviors:PasswordBoxBindingBehavior.Password}"
                                    BorderBrush="Transparent"
									Visibility="Collapsed" BorderThickness="1" IsReadOnly="True" />
                            <TextBlock x:Name="Message"
                                       Grid.Column="0"
                                       Grid.Row="1"
                                       Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                       Padding="{TemplateBinding Padding}"
                                       Visibility="Collapsed"
                                       Foreground="{TemplateBinding Foreground}"
                                       IsHitTestVisible="False"
                                       Opacity="0.6"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                       Margin="6,2,6,2" />
                            <Grid x:Name="FloatingMessageContainer"
                                  Grid.Column="0"
                                  Grid.ColumnSpan="2"
                                  Height="0"
                                  IsHitTestVisible="False"
                                  Margin="5,0"
                                  Visibility="Visible">
                                <TextBlock x:Name="FloatingMessage"
                                           Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                           FontSize="{DynamicResource FloatingWatermarkFontSize}"
                                           Foreground="{TemplateBinding Foreground}"
                                           Opacity="0.6"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <TextBlock.RenderTransform>
                                        <TranslateTransform />
                                    </TextBlock.RenderTransform>
                                </TextBlock>
                            </Grid>
                            <Button x:Name="PART_RevealButton"
									Grid.Column="2" Grid.RowSpan="2"
                                    Style="{StaticResource RevealButtonStyle}"
                                    SnapsToDevicePixels="True"
									Foreground="{TemplateBinding Foreground}"
                                    IsTabStop="False"
									Visibility="{Binding ElementName=RevealedPassword, Path=Text, Converter={StaticResource StringToVisibilityConverter}}">
                            </Button>
                            <ContentPresenter x:Name="PART_CapsLockIndicator"
                                              Grid.Row="0"
                                              Grid.Column="1"
                                              Grid.RowSpan="2"
                                              Margin="1"
                                              TextBlock.Foreground="{DynamicResource ControlsValidationBrush}"
                                              Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockIcon), Mode=TwoWay}"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="Right"
                                              ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockWarningToolTip), Mode=OneWay}"
                                              Visibility="Collapsed" />
                        </Grid>
                        <Border x:Name="DisabledVisualElement"
                                Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.DisabledVisualElementVisibility), Mode=OneWay}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderBrush="{DynamicResource ControlsDisabledBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{DynamicResource ControlsDisabledBrush}"
                                IsHitTestVisible="False"
                                Opacity="0" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Password, Mode=OneWay}"
                                     Value="">
                            <Setter TargetName="Message"
                                    Property="Visibility"
                                    Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=PART_RevealButton, Path=IsPressed}" Value="True">
                            <Setter TargetName="RevealedPassword" Property="Visibility" Value="Visible" />
                            <Setter Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
                            <Setter Property="PasswordChar" Value=" " />
                        </DataTrigger>
                        <!--Sets the MiniMessage visibility (Watermark must not be "" and FloatWatermark must be true)-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.HasText)}"
                                     Value="False">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                        <!--To override Watermark == ""-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.Watermark)}"
                                     Value="">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                        <!--To override TextBoxHelper.FloatingWatermark == false-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.UseFloatingWatermark)}"
                                     Value="False">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                        <Trigger Property="IsMouseOver"
                                 Value="True">
                            <Setter TargetName="Base"
                                    Property="BorderBrush"
                                    Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="False">
                            <Setter TargetName="DisabledVisualElement"
                                    Property="Opacity"
                                    Value="0.6" />
                        </Trigger>
                        <Trigger Property="IsFocused"
                                 Value="True">
                            <Setter TargetName="Base"
                                    Property="BorderBrush"
                                    Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
                            <Setter TargetName="FloatingMessage"
                                    Property="Foreground"
                                    Value="{DynamicResource AccentColorBrush}" />
                            <Setter TargetName="FloatingMessage"
                                    Property="Opacity"
                                    Value="1" />
                        </Trigger>
                        <Trigger SourceName="PART_RevealButton"
                                 Property="IsMouseOver"
                                 Value="True">
                            <Setter TargetName="PART_RevealButton"
                                    Property="Background"
                                    Value="{DynamicResource GrayBrush8}" />
                            <Setter TargetName="PART_RevealButton"
                                    Property="Foreground"
                                    Value="{DynamicResource AccentColorBrush}" />
                        </Trigger>
                        <Trigger SourceName="PART_RevealButton"
                                 Property="IsPressed"
                                 Value="True">
                            <Setter TargetName="PART_RevealButton"
                                    Property="Background"
                                    Value="{DynamicResource BlackBrush}" />
                            <Setter TargetName="PART_RevealButton"
                                    Property="Foreground"
                                    Value="{DynamicResource WhiteBrush}" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Controls:TextBoxHelper.HasText"
                                           Value="False" />
                                <Condition Property="IsFocused"
                                           Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterGotFocus}" />
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitGotFocus}" />
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>
                        <Trigger Property="Controls:TextBoxHelper.HasText"
                                 Value="True">
                            <Setter TargetName="Message"
                                    Property="Visibility"
                                    Value="Visible" />
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterHasText}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitHasText}" />
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
